import { request } from '@umijs/max';

export async function fakeSubmitForm(params) {
  return request('/comment/restaurant/basic_info/upsert', {
    method: 'POST',
    data: params,
  });
}


export async function getUserFn() {
  return request(`/comment/restaurant/basic_info/list`, {
    method: 'GET',
  });
}

export async function getActiveListFn(merchant_id) {
  return request(`/comment/restaurant/event/${merchant_id}`, {
    method: 'GET',
  });
}

export async function updateActiveListFn(params) {
  return request(`/comment/restaurant/event/save`, {
    method: 'POST',
    data: params
  });
}

export async function getQrcode(token) {
  return request('/comment/merchant/api_key', {
    method: 'GET',
    headers: {
      'Authorization': token
    },
  });
}


export async function login(body) {
  return request('/comment/token', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
  });
}
